﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;

namespace IntoMes.Models
{
    public class ProductIdentity
    {
        public DateTime DateTime { get; set; }
        public string ProductMode { get; set; }
        [Key]
        public string TrayId { get; set; }
        public string Result { get; set; }
        public bool IsRepair { get; set; }

        public string OP10PartCode1 { get; set; }
        public string OP10PartCode2 { get; set; }
        public string OP10PartCode3 { get; set; }
        public float OP10LD1NJ { get; set; }
        public float OP10LD1JD { get; set; }
        public float OP10LD2NJ { get; set; }
        public float OP10LD2JD { get; set; }
        public string OP10Result { get; set; }

        public string OP20PartCode1 { get; set; }
        public string OP20PartCode2 { get; set; }
        public string OP20PicturePath { get; set; }
        public string OP20Result { get; set; }

        public string OP30PartCode1 { get; set; }
        public string OP30Result { get; set; }

        public float OP50DY1 { get; set; }
        public float OP50DL1 { get; set; }
        public float OP50PL1 { get; set; }
        public float OP50ZKB1 { get; set; }
        public float OP50DY2 { get; set; }
        public float OP50DL2 { get; set; }
        public float OP50PL2 { get; set; }
        public float OP50ZKB2 { get; set; }
        public float OP50XLZ { get; set; }
        public float OP50YLZ { get; set; }
        public string OP50Result { get; set; }

        public string OP60PartCode1 { get; set; }
        public string OP60Result { get; set; }

        public string JZPicture1 { get; set; }
        public string JZPicture2 { get; set; }
        public string JZResult { get; set; }

        public string GP12Picture { get; set; }
        public string GP12Picture2 { get; set; }
        public string GP12Result { get; set; }
    }

    public class BeforeProductionQueryContext : DbContext
    {
        public BeforeProductionQueryContext() : base("BeforeProductionConnection") { }
        public virtual DbSet<ProductIdentity> Products { get; set; }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            Database.SetInitializer<BeforeProductionQueryContext>(null); 
        }
    }
}
